<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>访问统计</title>

<link rel="stylesheet"
	href="assets/bootstrap-table/bootstrap-table.css">
<link rel="stylesheet"
	href="assets/bootstrap-table/bootstrap-editable.css">
<script src="assets/bootstrap-table/jquery.min.js"></script>
<script src="assets/bootstrap-table/bootstrap.min.js"></script>
<script src="assets/bootstrap-table/bootstrap-table.js"></script>
<script src="assets/bootstrap-table/bootstrap-table-export.js"></script>
<script src="assets/bootstrap-table/tableExport.js"></script>
<script src="assets/bootstrap-table/bootstrap-table-editable.js"></script>
<script src="assets/bootstrap-table/bootstrap-editable.js"></script>
<script src="js/bootstrap-table-zh-CN.min.js"></script>

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/json2/20140204/json2.min.js"></script>
<![endif]-->
<style>
.ml10 {
	margin-left: 10px;
}

#operate-success {

	font-size: 16px;
	background-color: #8AC007;
	color: #FBFBFB;
	visibility: hidden
}
</style>
</head>
<body>
	<div class="container-fluid">
		<div class="page-header">
			<h1>访问统计&nbsp;&nbsp;</h1>
		</div>
		<div style="text-align: center;">
			<span id="operate-success">设置成功</span>
		</div>
		<div id="toolbar" class="btn-group">
		 <button class="btn btn-default dropdown-toggle " type="button" data-toggle="dropdown">
                                                                     选择查询页面<span class="caret"></span>
                      <ul class="dropdown-menu " role="menu" aria-labelledby="dropdownMenu1" >
                       <li role="presentation"><a role="menuitem" id="index" tabindex="-1" href="#">首  页</a></li>                      
                       <li role="presentation"><a role="menuitem" id="notHire" tabindex="-1" href="#">房屋出租</a></li>
                       <li role="presentation"><a role="menuitem" id="assetDetail" tabindex="-1" href="#">房屋详情</a></li>
                       <li role="presentation"><a role="menuitem" id="chart" tabindex="-1" href="#">租房合同</a></li>
                       <li role="presentation"><a role="menuitem" id="hire" tabindex="-1" href="#">交租情况</a></li>
                       <li role="presentation"><a role="menuitem" id="userassetset" tabindex="-1" href="#">用户设置</a></li>
                     </ul>
          </button>
		</div>
		<div>
			<table id="table" data-toggle="table" data-show-export="false"
				data-toolbar="#toolbar"
				data-url="mobile/asset/selectAllAccess.do" data-search="true"
				data-show-refresh="true" data-show-toggle="true"
				data-side-pagination="server" data-pagination="true"
				data-show-columns="true" data-sort-order="desc">
				<thead>
					<tr>
						<!-- <th data-field="state" data-checkbox="true"></th> -->
						<th data-field="nickname">昵称</th>
						<th data-field="openId">openId</th>
						<th data-field="imgUrl">头像</th>
						<th data-field="sex" data-formatter="statusSex">性别</th>
					    <th data-field="charter">承租人姓名</th>
					    <th data-field="hirePhone">承租人手机号</th>
						<th data-field="idno">承租人证件号</th>
						<th data-field="subScribe">关注</th>
						<th data-field="subscribeTime" data-formatter="actionTime" data-sortable="true">关注时间</th>
						<th data-field="page" data-formatter="page">访问页面</th>
						<th data-field="accessTime" data-formatter="actionTime" data-sortable="true">访问时间</th>
						<th data-field="city" data-visible="false">城市</th>												
						<th data-field="country" data-visible="false">国家</th>
						<th data-field="province" data-visible="false">省份</th>
					</tr>
				</thead>
			</table>
		</div>
	</div>
	<script>
	var campusId=1;
	
	function statusSex(value, row, index) {
		if (value == "0")
			return "?";
		else if (value == "1") {
			return "男";
		}else if (value == "2") {
			return "女";
		}
	  }
	
	 function actionTime(value, row, index){
	        var date = new Date(value);
	        Y = date.getFullYear() + '-';
	        M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
	        D = date.getDate() + ' ';
	        h = date.getHours() + ':';
	        m = date.getMinutes() + ':';
	        s = date.getSeconds();
	        return Y+M+D+h+m+s;
	    }
	 
	 function page(value, row, index){
		 if(value=="chart"){
			 return "租房合同";
		 }else if(value=="index"){
			 return "首  页";
		 }else if(value=="userassetset"){
			 return "用户设置";
		 }else if(value=="notHire"){
			 return "房屋出租";
		 }else if(value=="hire"){
			 return "交租情况";
		 }else if(value=="assetDetail"){
			 return "房屋详情";
		 }else{
			 return value;
		 }
	 }
	 
	 var url="mobile/asset/selectAllAccess.do"
	 
	$("#index").on("click",function(){

		    	var url2=url+"?page=index"
		    	$(" #table").bootstrapTable('refresh',{
					url : url2
				});
		    	
		});
	 
	 $("#notHire").on("click",function(){

	    	var url2=url+"?page=notHire"
	    	$(" #table").bootstrapTable('refresh',{
				url : url2
			});
	    	
	});
	 
	 $("#assetDetail").on("click",function(){

	    	var url2=url+"?page=assetDetail"
	    	$(" #table").bootstrapTable('refresh',{
				url : url2
			});
	    	
	});
	 
	 $("#chart").on("click",function(){

	    	var url2=url+"?page=chart"
	    	$(" #table").bootstrapTable('refresh',{
				url : url2
			});
	    	
	    });
	 
	 $("#hire").on("click",function(){

	    	var url2=url+"?page=hire"
	    	$(" #table").bootstrapTable('refresh',{
				url : url2
			});
	    	
	});
	 
	 $("#userassetset").on("click",function(){

	    	var url2=url+"?page=userassetset"
	    	$(" #table").bootstrapTable('refresh',{
				url : url2
			});
	    	
	});
	 
	</script>
</body>
</html>